#include <stdlib.h>
#include <boost/lexical_cast.hpp>
#include <vector>

#include "include/Package.h"
#include "include/GlobalGameObj.h"
#include "include/Utils.h"

using namespace boost;

int Package::GetTotalNum(GlobalGameObj *p_game_obj)
{
    string sql = "select count(order_by) from tbl_package where character_id = " +
        lexical_cast<string>(p_game_obj->character_id) + ";";

    string str = p_game_obj->model_proxy.GetSingleStrBySql(sql);
    if("" == str)
    {
        return 0;
    }

    return lexical_cast<int>(str);
}

int Package::GetTotalEmptyNum(GlobalGameObj *p_game_obj)
{
    string sql = "select count(order_by) from tbl_package where character_id = " +
        lexical_cast<string>(p_game_obj->character_id) + "and stack_num = 0;";

    string str = p_game_obj->model_proxy.GetSingleStrBySql(sql);
    if("" == str)
    {
        return 0;
    }

    return lexical_cast<int>(str);
}

int Package::GetEquipByChEquipId(GlobalGameObj *p_game_obj, int ch_equip_id)
{
    return 0;
}



